#!/bin/sh
if [ $HARD_VER != B231 -a $HARD_VER != C151 -a $HARD_VER != C251 -a $( cat /etc/version_info | awk -F ""  '{print $4}') -lt 6 ];then
    exit 1
fi
dev=/dev/ttyUSB3

        case "$1" in
    "imsi" )
        /home/update/at $dev AT+CIMI;;

    "iccid" )
        /home/update/at $dev AT+QCCID;;

    "csq" )
        /home/update/at $dev AT+CSQ;;

    "sim_status" )
        /home/update/at $dev AT+CPIN?;;

    "network_mode" )
        /home/update/at $dev AT+QNWINFO;;

    "open_gpsonly" )
        /home/update/at $dev AT+QGPS=1;;

    "open_gps" )
        while [ ! $(ls -l /dev/ttyUSB1) ]; do
            sleep 1
        done
        /home/update/at $dev AT+QGPS=1
        chmod 777 /home/update/gps_syntime
        /home/update/gps_syntime /dev/ttyUSB1;;

    *)
        exit 1 ;;
        esac
